package com.dc.auth.service;

import com.alibaba.fastjson.JSONObject;
import com.dc.base.BaseResponse;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author: KEYD
 * @Date: 2020/1/18 19:09
 * @Desc: auth2.0 验证授权中心的接口
 */
public interface IAuthorizationService {
    /**
     * 机构申请 获取appId 和 appSecret
     */
    @GetMapping("/applyAppInfo")
    public BaseResponse<JSONObject> applyAppInfo(@RequestParam("appName") String appName);

    /**
     * 使用 appid 和 appsecret 秘钥获取 AccessToken
     */
    @GetMapping("/getAccessToken")
    public BaseResponse<JSONObject> getAccessToken(@RequestParam("appId") String appId,
                                                   @RequestParam("appSecret") String appSecret);

    /**
     * 验证Token是否失败
     */
    @GetMapping("/getAppInfo")
    public BaseResponse<JSONObject> getAppInfo(@RequestParam("accessToken") String accessToken);


}
